<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>方法调度</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../static/css/element-ui-2.6.14.css">
    <style>
        .el-header{
            color: #333;
            padding: 11px;
            background: white;
            margin: 0 0 5px 0;
        }
        .el-main {
            color: #333;
            padding: 0;
            background:white;
            text-align: center;
        }
        .el-dropdown-link {
            cursor: pointer;
            color: #409EFF;
        }
        .el-icon-arrow-down {
            font-size: 12px;
        }
        .logMail .el-switch__label{
            height: 42px;
        }
        .logDialog .el-dialog__body{
            padding-top: 0px !important;
        }
        .logDialog .el-dialog {
            margin-top: 10vh !important;
        }
    </style>
</head>
<body>
    <div id="app">
        <el-container>
            <el-header>
                <el-form :inline="true" :model="queryForm" class="demo-form-inline">
                    <el-form-item label="模块">
                        <el-select v-model="queryForm.beanName" clearable placeholder="方法">
                            <el-option
                                    v-for="(item,key) in taskModuleMap"
                                    :key="key"
                                    :label="key"
                                    :value="item">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="方法">
                        <el-select v-model="queryForm.methodName" clearable placeholder="方法">
                            <el-option
                                v-for="(item,key) in taskMethodDocMap[queryForm.beanName]"
                                :key="item.methodName"
                                :label="item.methodDesc"
                                :value="item.methodName">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="参数">
                        <el-input v-model="queryForm.methodParams" clearable placeholder="参数"></el-input>
                    </el-form-item>
                    <el-form-item label="状态">
                        <el-select v-model="queryForm.status" clearable placeholder="状态">
                            <el-option
                                    v-for="(item,key) in SysJobStatus"
                                    :key="key"
                                    :label="item"
                                    :value="key">
                            </el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item>
                        <el-button type="primary" @click="initSysMethodJobs">查询</el-button>
                    </el-form-item>
                </el-form>
            </el-header>
            <el-main>
                <el-row>
                    <el-col :offset="22" :span="2">
                        <el-button style="margin:10px 0;" type="primary" v-if="auth.add" size="mini" @click="openCreateDialog" icon="el-icon-plus" >创建</el-button>
                    </el-col>
                </el-row>
                <el-table
                        :data="sysMethodJobs"
                        border
                        :header-cell-style="getRowClass"
                        style="width:98%;margin:0 10px;">
                    <el-table-column
                            prop="id"
                            label="ID"
                            width="60">
                    </el-table-column>
                    <el-table-column
                            prop="note"
                            label="描述"
                            width="200">
                    </el-table-column>
                    <el-table-column
                            prop="methodName"
                            width="280"
                            sortable
                            label="方法">
                    </el-table-column>
                    <el-table-column
                            prop="methodParams"
                            label="参数">
                    </el-table-column>
                    <el-table-column
                            label="cron表达式"
                            width="120">
                        <template slot-scope="scope">
                            <el-tag>{{scope.row.cronExpression}}</el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column
                            label="状态"
                            width="140">
                        <template slot-scope="scope">
                            <el-switch
                                    style="display: block"
                                    @change="updateSysMethodJobStatus(scope.row)"
                                    v-model="scope.row.status"
                                    active-value="RUN"
                                    active-color="#13ce66"
                                    active-text="运行"
                                    inactive-value="STOP"
                                    inactive-color="#ff4949"
                                    inactive-text="停用">
                            </el-switch>
                        </template>
                    </el-table-column>
                    <el-table-column
                            label="操作"
                            width="110">
                        <template slot-scope="scope">
                            <el-dropdown @command="handleCommand" trigger="click">
                                <span class="el-dropdown-link">
                                    更多操作<i class="el-icon-arrow-down el-icon--right"></i>
                                </span>
                                <el-dropdown-menu slot="dropdown">
                                    <el-dropdown-item type="primary" size="mini" :command="beforeHandleCommand('openLogDialog',scope.row)">查询日志</el-dropdown-item>
                                    <el-dropdown-item type="primary" size="mini" v-if="auth.run" :command="beforeHandleCommand('openRunSysMethodJob',scope.row)">运行一次</el-dropdown-item>
                                    <el-dropdown-item type="primary" size="mini" v-if="auth.detail" :command="beforeHandleCommand('openDetailDialog',scope.row)">详情</el-dropdown-item>
                                    <el-dropdown-item type="primary" size="mini" v-if="auth.update" :command="beforeHandleCommand('openUpdateDialog',scope.row)">修改</el-dropdown-item>
                                    <el-dropdown-item type="primary" size="mini" v-if="auth.delete" :command="beforeHandleCommand('deleteSysMethodJob',scope.row)">删除</el-dropdown-item>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="page.page"
                        :page-sizes="[10, 20, 50, 100]"
                        :page-size="page.pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="page.total">
                </el-pagination>
            </el-main>
        </el-container>

        <!-- 对话框 新增-->
        <el-dialog title="创建方法定时任务" :visible.sync="createDialogVisible" :close-on-click-modal="false">
            <el-form :model="createForm" label-width="100px">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="模块">
                            <el-select v-model="createForm.beanName" @change="changeBeanName" clearable placeholder="方法">
                                <el-option
                                        v-for="(item,key) in taskModuleMap"
                                        :key="key"
                                        :label="key"
                                        :value="item">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="方法">
                            <el-select v-model="createForm.methodName" @change="changeMethodName" placeholder="请选择方法">
                                <el-option
                                        v-for="(item,key) in taskMethodList"
                                        :key="item.methodName"
                                        :label="item.methodDesc"
                                        :value="item.methodName">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-form-item label="参数">
                    <el-popover
                            ref="popover"
                            title="参数文档"
                            placement="top-start"
                            width="500"
                            trigger="focus">
                        <template>
                            <el-table
                                    :data="taskParamList"
                                    border
                                    style="width: 100%">
                                <el-table-column
                                        prop="key"
                                        label="参数名"
                                        width="100">
                                </el-table-column>
                                <el-table-column
                                        prop="type"
                                        label="数据类型"
                                        width="80">
                                </el-table-column>
                                <el-table-column
                                        prop="require"
                                        :formatter="formatter"
                                        label="是否必填"
                                        width="80">
                                </el-table-column>
                                <el-table-column
                                        prop="example"
                                        label="样例">
                                </el-table-column>
                                <el-table-column
                                        prop="desc"
                                        label="描述"
                                        width="120">
                                </el-table-column>
                            </el-table>
                        </template>
                        <el-input v-model="createForm.methodParams" slot="reference" autocomplete="off"></el-input>
                    </el-popover>
                </el-form-item>
                <el-form-item label="cron表达式">
                    <el-input v-model="createForm.cronExpression" autocomplete="off"></el-input>
                </el-form-item>
                <el-row class="logMail">
                    <el-col :span="12" type="flex">
                        <el-form-item label="记录日志">
                            <el-switch
                                    style="line-height: 40px;"
                                    v-model="createForm.logStatus"
                                    active-value="ON"
                                    active-color="#13ce66"
                                    active-text="开启"
                                    inactive-value="OFF"
                                    inactive-color="#ff4949"
                                    inactive-text="关闭">
                            </el-switch>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12" type="flex">
                        <el-form-item label="发送邮件">
                            <el-switch
                                    style="line-height: 40px;"
                                    v-model="createForm.mailStatus"
                                    active-value="ON"
                                    active-color="#13ce66"
                                    active-text="开启"
                                    inactive-value="OFF"
                                    inactive-color="#ff4949"
                                    inactive-text="关闭">
                            </el-switch>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item label="邮箱">
                        <el-input v-model="createForm.mailAddress" placeholder="以逗号分割" autocomplete="off"></el-input>
                    </el-form-item>
                </el-row>
                <el-form-item label="描述">
                    <el-input v-model="createForm.note" autocomplete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="createDialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="createSysMethodJob">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 对话框 修改-->
        <el-dialog title="修改方法定时任务" :visible.sync="updateDialogVisible" :close-on-click-modal="false">
            <el-form :model="updateForm" label-width="100px">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="模块">
                            <el-input v-model="updateForm.beanName" placeholder="请选择方法" :disabled="true">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="方法">
                            <el-input v-model="updateForm.methodName" placeholder="请选择方法" :disabled="true">
                            </el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-form-item label="参数">
                    <el-popover
                            ref="popover"
                            title="参数文档"
                            placement="top-start"
                            width="500"
                            trigger="focus">
                        <template>
                            <el-table
                                    :data="taskParamList"
                                    border
                                    style="width: 100%">
                                <el-table-column
                                        prop="key"
                                        label="参数名"
                                        width="100">
                                </el-table-column>
                                <el-table-column
                                        prop="type"
                                        label="数据类型"
                                        width="80">
                                </el-table-column>
                                <el-table-column
                                        prop="require"
                                        :formatter="formatter"
                                        label="是否必填"
                                        width="80">
                                </el-table-column>
                                <el-table-column
                                        prop="example"
                                        label="样例">
                                </el-table-column>
                                <el-table-column
                                        prop="desc"
                                        label="描述"
                                        width="120">
                                </el-table-column>
                            </el-table>
                        </template>
                        <el-input v-model="updateForm.methodParams" slot="reference" autocomplete="off"></el-input>
                    </el-popover>
                </el-form-item>
                <el-form-item label="cron表达式">
                    <el-input v-model="updateForm.cronExpression" autocomplete="off"></el-input>
                </el-form-item>
                <el-row class="logMail">
                    <el-col :span="12" type="flex">
                        <el-form-item label="记录日志">
                            <el-switch
                                    style="line-height: 40px;"
                                    v-model="updateForm.logStatus"
                                    active-value="ON"
                                    active-color="#13ce66"
                                    active-text="开启"
                                    inactive-value="OFF"
                                    inactive-color="#ff4949"
                                    inactive-text="关闭">
                            </el-switch>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12" type="flex">
                        <el-form-item label="发送邮件">
                            <el-switch
                                    style="line-height: 40px;"
                                    v-model="updateForm.mailStatus"
                                    active-value="ON"
                                    active-color="#13ce66"
                                    active-text="开启"
                                    inactive-value="OFF"
                                    inactive-color="#ff4949"
                                    inactive-text="关闭">
                            </el-switch>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item label="邮箱">
                        <el-input v-model="updateForm.mailAddress" placeholder="以逗号分割" autocomplete="off"></el-input>
                    </el-form-item>
                </el-row>
                <el-form-item label="描述">
                    <el-input v-model="updateForm.note" autocomplete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="updateDialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="updateSysMethodJob">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 详情 -->
        <el-dialog title="定时任务详情" :visible.sync="detailDialogVisible" :close-on-click-modal="false">
            <el-form :model="detailForm" label-width="100px">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="模块">
                            <el-input v-model="detailForm.beanName" placeholder="请选择方法" :disabled="true">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="方法">
                            <el-input v-model="detailForm.methodName" placeholder="请选择方法" :disabled="true">
                            </el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item label="参数">
                        <el-input v-model="detailForm.methodParams" :disabled="true" autocomplete="off"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="cron表达式">
                            <el-input v-model="detailForm.cronExpression" :disabled="true" autocomplete="off"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="状态">
                            <el-input v-model="detailForm.status" :disabled="true" autocomplete="off"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row class="logMail">
                    <el-col :span="12" type="flex">
                        <el-form-item label="记录日志">
                            <el-switch
                                style="line-height: 40px;"
                                v-model="detailForm.logStatus"
                                active-value="ON"
                                active-color="#13ce66"
                                active-text="开启"
                                inactive-value="OFF"
                                inactive-color="#ff4949"
                                inactive-text="关闭"
                                disabled
                            >
                            </el-switch>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12" type="flex">
                        <el-form-item label="发送邮件">
                            <el-switch
                                style="line-height: 40px;"
                                v-model="detailForm.mailStatus"
                                active-value="ON"
                                active-color="#13ce66"
                                active-text="开启"
                                inactive-value="OFF"
                                inactive-color="#ff4949"
                                inactive-text="关闭"
                                disabled
                            >
                            </el-switch>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item label="邮箱">
                        <el-input v-model="detailForm.mailAddress" :disabled="true" autocomplete="off"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="创建时间">
                            <el-input v-model="detailForm.createTime" :disabled="true" autocomplete="off"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="更新时间">
                            <el-input v-model="detailForm.updateTime" :disabled="true" autocomplete="off"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="描述">
                            <el-input type="textarea" v-model="detailForm.note" :disabled="true" autocomplete="off"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="detailDialogVisible = false">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 对话框 运行一次-->
        <el-dialog title="运行一次任务" :visible.sync="runDialogVisible" :close-on-click-modal="false">
            <el-form :model="runForm" label-width="100px">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="模块">
                            <el-input v-model="runForm.beanName" placeholder="请选择方法" :disabled="true">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="方法">
                            <el-input v-model="runForm.methodName" placeholder="请选择方法" :disabled="true">
                            </el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-form-item label="参数">
                    <el-popover
                            ref="popover"
                            title="参数文档"
                            placement="top-start"
                            width="500"
                            trigger="focus">
                        <template>
                            <el-table
                                    :data="taskParamList"
                                    border
                                    style="width: 100%">
                                <el-table-column
                                        prop="key"
                                        label="参数名"
                                        width="100">
                                </el-table-column>
                                <el-table-column
                                        prop="type"
                                        label="数据类型"
                                        width="80">
                                </el-table-column>
                                <el-table-column
                                        prop="require"
                                        :formatter="formatter"
                                        label="是否必填"
                                        width="80">
                                </el-table-column>
                                <el-table-column
                                        prop="example"
                                        label="样例">
                                </el-table-column>
                                <el-table-column
                                        prop="desc"
                                        label="描述"
                                        width="120">
                                </el-table-column>
                            </el-table>
                        </template>
                        <el-input v-model="runForm.methodParams" slot="reference" autocomplete="off"></el-input>
                    </el-popover>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="runDialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="runSysMethodJob">运 行</el-button>
            </div>
        </el-dialog>

        <!-- 日志 -->
        <el-dialog class="logDialog" title="调度日志" :visible.sync="logDialogVisible" width="80%" :close-on-click-modal="false">
            <iframe :src="'sys-job-log-list.html?jobId='+ logJobId" style="width:100%;height: 500px;" frameborder="0" scrolling="true"></iframe>
        </el-dialog>
    </div>

<script type="text/javascript" src="../static/js/vue.min-2.6.14.js"></script>
<!-- 引入组件库 -->
<script src="../static/js/element-ui-2.15.6.js"></script>
<script src="../static/js/axios.min.js"></script>
<script src="../static/js/app.js"></script>
<script>

    new Vue({
        el: '#app',
        data:{
            taskModuleMap: [],
            taskMethodDocMap:{},
            taskMethodList:[],
            taskParamList: [],

            sysMethodJobs:[],
            sysMethodJob:{},

            page:{
                page:1,
                pageSize:10,
                total:0
            },

            queryForm:{},
            SysJobStatus:[],

            createDialogVisible:false,
            createForm:{
                logStatus: 'OFF',
                mailStatus: 'OFF'
            },

            updateDialogVisible:false,
            updateForm:{},

            runDialogVisible:false,
            runForm:{},

            detailDialogVisible:false,
            detailForm:{},

            logJobId:0,
            logDialogVisible:false,

            auth:{
                menuCode:'method_job',
                add:false,
                update:false,
                delete:false,
                detail:false,
                run:false
            }

        },
        created(){
            initAuth(this.auth);
            this.initEnumList();
            this.initSysMethodJobs();
        },
        methods: {
            initSysMethodJobs(){
                axios.post(domain + "/sysMethodJob/querySysMethodJobByPage",{
                    page:this.page.page,
                    pageSize:this.page.pageSize,
                    beanName: this.queryForm.beanName,
                    methodName: this.queryForm.methodName,
                    methodParams: this.queryForm.methodParams,
                    status: this.queryForm.status
                }).then(resp=>{
                    var res = resp.data;
                    if (res.status == 200){
                        this.sysMethodJobs = res.data.rows;
                        this.page.total = res.data.records;
                    }else {
                        notify(resp)
                    }
                });
            },
            handleSizeChange(val){
                if(this.page.pageSize != val){
                    this.page.pageSize = val;
                    this.initSysMethodJobs();
                }
            },
            handleCurrentChange(val){
                if(this.page.page != val){
                    this.page.page = val;
                    this.initSysMethodJobs();
                }
            },
            openCreateDialog(){
                this.createForm.beanName = null;
                this.createForm.methodName = null;
                this.createDialogVisible = true;
                this.taskParamList = null;
                this.taskMethodList = null;
            },
            handleCommand(command){
                switch(command.fun){
                    case "openLogDialog":
                        this.openLogDialog(command.row);
                        break;
                    case "openRunSysMethodJob":
                        this.openRunSysMethodJob(command.row);
                        break;
                    case "openDetailDialog":
                        this.openDetailDialog(command.row);
                        break;
                    case "openUpdateDialog":
                        this.openUpdateDialog(command.row);
                        break;
                    case "deleteSysMethodJob":
                        this.deleteSysMethodJob(command.row);
                        break;
                }
            },
            beforeHandleCommand(fun,row){
                return {
                    'fun':fun,
                    'row':row
                }
            },
            createSysMethodJob(){
                axios.post(domain + "/sysMethodJob/saveSysMethodJob",this.createForm).then(resp=>{
                    if (notifyAndReloadAndDialog(this, resp, "initSysMethodJobs", "createDialogVisible")) {
                        this.createForm = {};
                    }
                });

            },
            updateSysMethodJobStatus(row){
                this.sysMethodJob.id = row.id;
                this.sysMethodJob.status = row.status;
                axios.post(domain + "/sysMethodJob/updateSysMethodJobStatus",this.sysMethodJob).then(resp=>{
                    if (notifyAndReload(this, resp, "initSysMethodJobs")) {
                        this.sysMethodJob = {};
                    }
                });
            },
            changeBeanName(){
                this.createForm.methodName = null;
                this.taskMethodList = this.taskMethodDocMap[this.createForm.beanName]
                this.taskParamList = null;
            },
            changeMethodName(){
                this.taskParamList = this.taskMethodList[this.createForm.methodName].taskParamList
            },
            openLogDialog(row){
                this.logJobId = row.id;
                this.logDialogVisible = true;
            },
            openUpdateDialog(row){
                if (row.status == 'RUN'){
                    this.$message({
                        message: "修改任务前必须停止该任务",
                        type: 'warning'
                    });
                    return;
                }
                axios.get(domain + "/sysMethodJob/querySysMethodJobById",{
                    params:{
                        id:row.id
                    }
                }).then(resp=>{
                    const res = resp.data;
                    if (res.status == 200){
                        this.updateForm = res.data;
                        this.taskMethodList = this.taskMethodDocMap[this.updateForm.beanName]
                        this.taskParamList = this.taskMethodList[this.updateForm.methodName].taskParamList
                    }else {
                        notify(resp)
                    }
                })
                this.updateDialogVisible = true;
            },
            openRunSysMethodJob(row){
                this.runDialogVisible = true;
                axios.get(domain + "/sysMethodJob/querySysMethodJobById",{
                    params:{
                        id:row.id
                    }
                }).then(resp=>{
                    const res = resp.data;
                    if (res.status == 200){
                        this.runForm = res.data;
                        this.taskMethodList = this.taskMethodDocMap[this.runForm.beanName]
                        this.taskParamList = this.taskMethodList[this.runForm.methodName].taskParamList
                    }else {
                        notify(resp)
                    }
                })
            },
            updateSysMethodJob(){
                axios.post(domain + "/sysMethodJob/updateSysMethodJobWithNoStatus",this.updateForm).then(resp=>{
                    if (notifyAndReloadAndDialog(this, resp, "initSysMethodJobs", "updateDialogVisible")) {
                        this.updateForm = {};
                    }
                });
            },
            openDetailDialog(row){
                axios.get(domain + "/sysMethodJob/querySysMethodJobById",{
                    params:{
                        id:row.id
                    }
                }).then(resp=>{
                    const res = resp.data;
                    if (res.status == 200){
                        this.detailForm = res.data;
                    }else {
                        notify(resp)
                    }
                })
                this.detailDialogVisible = true;
            },
            runSysMethodJob(row){
                axios.post(domain + "/sysMethodJob/runSysMethodJob",this.runForm).then(resp=>{
                    if(notify(resp)){
                        this.runDialogVisible = false;
                    }
                })
            },
            initEnumList(){

                axios.get(domain + "/sysMethodJob/getMethodDocumentMap").then(resp=>{
                    const res = resp.data;
                    if (res.status == 200){
                        this.taskMethodDocMap = res.data;
                    }else {
                        notify(resp)
                    }
                })
                axios.get(domain + "/sysMethodJob/getTaskModuleMap").then(resp=>{
                    const res = resp.data;
                    if (res.status == 200){
                        this.taskModuleMap = res.data;
                    }else {
                        notify(resp)
                    }
                });
                axios.get(domain + "/sysServerNode/getScheduleEnumList").then(resp=>{
                    const res = resp.data;
                    if (res.status == 200){
                        this.SysJobStatus = res.data.SysJobStatus;
                    }else {
                        notify(resp)
                    }
                });

            },
            deleteSysMethodJob(row){
                axios.post(domain + "/sysMethodJob/deleteSysMethodJob","id="+row.id).then(resp=>{
                    notifyAndReload(this, resp, "initSysMethodJobs");
                });
            },
            getRowClass({ rowIndex }){
                if (rowIndex == 0) {
                    return 'background:RGB(238,239,246)'
                } else {
                    return ''
                }
            },
            lineFeedTime(cellValue){
                return cellValue.replace(" ",'</br>&ensp;');
            },
            formatter(row ,index){
                if (row.require){
                    row.require = "必填"
                }else {
                    row.require = "非必填"
                }
                return row.require;
            }
        }
    })

</script>
</body>
</html>
